package com.itheima.TCPdemo.处理中文乱码;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        ServerSocket ss=new ServerSocket(10000);

        Socket socket = ss.accept();
        InputStream is = socket.getInputStream();
        //只需要把字节流变成字符流就可以了
        InputStreamReader isr=new InputStreamReader(is);//字节流传入，变成字符流了

        int b=0;
        while ((b=isr.read())!=-1){
            System.out.println((char)b);
        }


        socket.close();
        ss.close();
    }
}
